$(function() {
    $("#banner").scrollBanner({
        images : [
            {src:"./images/index/banner1.png",title:"banner1",href:"#"},
            {src:"./images/index/banner2.png",title:"banner2",href:"#"},
            {src:"./images/index/banner3.png",title:"banner3",href:"#"}
        ],
        scrollTime:3000,
        bannerHeight:"484px",
        iconColor: "#FFFFFF",
        iconHoverColor : "#82C900",
        iconPosition : "center"
    });
	// $(".header-bg").hide();
    //
	// $(".product-item").hover(function() {
	// 	var no = $(this).attr("image-index");
	// 	var imageStr = getImageStr(no,true);
	// 	$(this).find("img").attr("src",imageStr);
	// 	$(this).addClass("active");
	// }, function() {
     //    var no = $(this).attr("image-index");
	// 	var imageStr = getImageStr(no,false);
	// 	$(this).find("img").attr("src",imageStr);
	// 	$(this).removeClass("active");
	// });
    //
	// setLocation();
})

function goTop() {
	window.scrollTo(0,0);
}

function getImageStr(no, bool) {
	var imageStrs = ["./image/mixing.png", "./image/transport.png", "./image/paving.png",
		"./image/rolling.png", "./image/person_management.png"
	];

	var imageStrs1 = ["./image/mixing2.png", "./image/transport2.png", "./image/paving2.png",
		"./image/rolling2.png", "./image/person_management2.png"
	];
	if (!bool) {
		return imageStrs[no - 1];
	}
	return imageStrs1[no - 1];
}

function setLocation() {
	$(".product-item").click(function(){
		var location = $(this).attr("data-location");
		if(location){
			window.location.href = location;
		}
	});
}